#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int ans = 1;
	int max = 1;
	int j;
	int k;
	cin >> k;
	for (int i = 0; i < n - 1; i++) {
		cin >> j;
		if (j > k && j == k + 1) {
			ans++;
		}
		else {
			ans = 1;
		}
		if (ans > max) {
			max = ans;
		}
		k = j;
	}
	cout << max << endl;
	return 0;
}